<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="jsp.bean.Customer"%>
<%@ page import="java.util.*"%>
<%@ taglib uri="http://www.sean.org/taglib/core" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
</head>
<body>
	<!-- 
		防盗链标签, 如果用户是从index.jsp过来的, 那么referer中的值为http://localhost:8080/JavaEE_Web/jsp/tag/index.jsp 
		如果用户是访问http://localhost:8080/JavaEE_Web/jsp/tag/testTag.jsp, 那么referer的值是null, 防盗链标签会重定向到index.jsp	
	-->
	<s:referer website="http://localhost:8080" redirectPage="/jsp/tag/index.jsp" />
	<br /> 
	20 + 10 = <s:arithmetic param1="20" param2="10" operator="+" />
	<br /> 
	
	20 - 30 = <s:arithmetic param1="20" param2="30" operator="-" />
	<br /> 
	
	15 Vs 17, the max one is <s:max number1="15" number2="13" />
	<br />

	<s:iterator iteratorCount="3">content</s:iterator>
	<br />

	<s:upperCase>hello world</s:upperCase>
	<br />
	<hr />

	<%
		// list 集合
		List<String> listData = new ArrayList<String>();
		listData.add("list1");
		listData.add("list2");
		listData.add("list3");

		// 对象数组
		Integer[] array1 = new Integer[] { 1, 2, 3 };

		// 基本数据类型数组
		int[] array2 = new int[] { 4, 5, 6 };

		// Map集合
		Map<String, String> mapData = new HashMap<String, String>();
		mapData.put("1", "1");
		mapData.put("2", "2");
		mapData.put("3", "3");

		//将集合存储到pageContext对象中
		pageContext.setAttribute("listData", listData);
		pageContext.setAttribute("array1", array1);
		pageContext.setAttribute("array2", array2);
		pageContext.setAttribute("mapData", mapData);
	%>

	<s:forEach items="${listData}" var="item">
		${item}<br />
	</s:forEach>
	<hr />
	
	<s:forEach items="${array1}" var="item">
    	${item}<br />
	</s:forEach>
	<hr />
	
	<s:forEach items="${array2}" var="item">
        ${item}<br />
	</s:forEach>
	<hr />
	
	<s:forEach items="${mapData}" var="item">
        ${item}<br />
	</s:forEach>
	<br />
	<hr />

	<s:choose>
		<s:when test="${param.age > 18}">Adult</s:when>
		<s:when test="${param.age > 12 }">Teenage</s:when>
		<s:otherwise>Children</s:otherwise>
	</s:choose>
	<hr />
	
	<s:escapeHtml><a href="http://localhost:8080">LocalHost</a></s:escapeHtml>
	<hr />
	
	<s:out value="<a href='http://localhost:8080'>LocalHost</a>" escapeHtml="true" /><br />
	<s:out value="<a href='http://localhost:8080'>LocalHost</a>" />
</body>
</html>